3.461 \(\int \frac {\tan (c+d x)}{a+b \tan (c+d x)} \, dx\)

Optimal. Leaf size=46 \[ \frac {b x}{a^2+b^2}-\frac {a \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )} \]

[Out]

b*x/(a^2+b^2)-a*ln(a*cos(d*x+c)+b*sin(d*x+c))/(a^2+b^2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3531, 3530} \[ \frac {b x}{a^2+b^2}-\frac {a \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + b*Tan[c + d*x]),x]

[Out]

(b*x)/(a^2 + b^2) - (a*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)*d)

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{a+b \tan (c+d x)} \, dx &=\frac {b x}{a^2+b^2}-\frac {a \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^2+b^2}\\ &=\frac {b x}{a^2+b^2}-\frac {a \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right ) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.13, size = 66, normalized size = 1.43 \[ \frac {2 (b-i a) (c+d x)-a \log \left ((a \cos (c+d x)+b \sin (c+d x))^2\right )+2 i a \tan ^{-1}(\tan (c+d x))}{2 d \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + b*Tan[c + d*x]),x]

[Out]

(2*((-I)*a + b)*(c + d*x) + (2*I)*a*ArcTan[Tan[c + d*x]] - a*Log[(a*Cos[c + d*x] + b*Sin[c + d*x])^2])/(2*(a^2
 + b^2)*d)

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 63, normalized size = 1.37 \[ \frac {2 \, b d x - a \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{2} + b^{2}\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*b*d*x - a*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)))/((a^2 + b^2)*d)

________________________________________________________________________________________

giac [A]  time = 0.68, size = 73, normalized size = 1.59 \[ -\frac {\frac {2 \, a b \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b + b^{3}} - \frac {2 \, {\left (d x + c\right )} b}{a^{2} + b^{2}} - \frac {a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(2*a*b*log(abs(b*tan(d*x + c) + a))/(a^2*b + b^3) - 2*(d*x + c)*b/(a^2 + b^2) - a*log(tan(d*x + c)^2 + 1)
/(a^2 + b^2))/d

________________________________________________________________________________________

maple [A]  time = 0.15, size = 75, normalized size = 1.63 \[ -\frac {a \ln \left (a +b \tan \left (d x +c \right )\right )}{d \left (a^{2}+b^{2}\right )}+\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}+\frac {b \arctan \left (\tan \left (d x +c \right )\right )}{d \left (a^{2}+b^{2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+b*tan(d*x+c)),x)

[Out]

-1/d*a/(a^2+b^2)*ln(a+b*tan(d*x+c))+1/2/d/(a^2+b^2)*a*ln(1+tan(d*x+c)^2)+1/d/(a^2+b^2)*b*arctan(tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.82, size = 68, normalized size = 1.48 \[ \frac {\frac {2 \, {\left (d x + c\right )} b}{a^{2} + b^{2}} - \frac {2 \, a \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} + b^{2}} + \frac {a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*b/(a^2 + b^2) - 2*a*log(b*tan(d*x + c) + a)/(a^2 + b^2) + a*log(tan(d*x + c)^2 + 1)/(a^2 + b^
2))/d

________________________________________________________________________________________

mupad [B]  time = 4.03, size = 76, normalized size = 1.65 \[ \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {a\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{d\,\left (a^2+b^2\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)/(a + b*tan(c + d*x)),x)

[Out]

log(tan(c + d*x) + 1i)/(2*d*(a - b*1i)) + (log(tan(c + d*x) - 1i)*1i)/(2*d*(a*1i - b)) - (a*log(a + b*tan(c +
d*x)))/(d*(a^2 + b^2))

________________________________________________________________________________________

sympy [A]  time = 0.88, size = 260, normalized size = 5.65 \[ \begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {d x \tan {\left (c + d x \right )}}{- 2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {i d x}{- 2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {1}{- 2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = - i b \\- \frac {d x \tan {\left (c + d x \right )}}{- 2 b d \tan {\left (c + d x \right )} - 2 i b d} - \frac {i d x}{- 2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {1}{- 2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = i b \\\frac {x \tan {\relax (c )}}{a + b \tan {\relax (c )}} & \text {for}\: d = 0 \\\frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {for}\: b = 0 \\- \frac {2 a \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {2 b d x}{2 a^{2} d + 2 b^{2} d} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*tan(d*x+c)),x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-d*x*tan(c + d*x)/(-2*b*d*tan(c + d*x) + 2*I*b*d) + I*d*x/
(-2*b*d*tan(c + d*x) + 2*I*b*d) + 1/(-2*b*d*tan(c + d*x) + 2*I*b*d), Eq(a, -I*b)), (-d*x*tan(c + d*x)/(-2*b*d*
tan(c + d*x) - 2*I*b*d) - I*d*x/(-2*b*d*tan(c + d*x) - 2*I*b*d) + 1/(-2*b*d*tan(c + d*x) - 2*I*b*d), Eq(a, I*b
)), (x*tan(c)/(a + b*tan(c)), Eq(d, 0)), (log(tan(c + d*x)**2 + 1)/(2*a*d), Eq(b, 0)), (-2*a*log(a/b + tan(c +
 d*x))/(2*a**2*d + 2*b**2*d) + a*log(tan(c + d*x)**2 + 1)/(2*a**2*d + 2*b**2*d) + 2*b*d*x/(2*a**2*d + 2*b**2*d
), True))

________________________________________________________________________________________